package com.shangqing.system.mapper;

import com.shangqing.system.domain.caoyuan.Caoyuan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CaoyuanMapper {
    @Select("select * from prairie_caoyuan where  isdelete=1")
    List<Caoyuan> getinfo();

    @Select("Select speciesId,  count(*) as count  From prairie_caoyuan where  isdelete=1 group by speciesId ")
    List<Caoyuan> getspecies();

    @Select("Select alertId,  count(*) as count  From prairie_caoyuan where month(occurrenceTime)=#{month} and isdelete=1 group by alertId")
    List<Caoyuan> getalert(int month);

    @Select("SELECT count(region)  from prairie_caoyuan where  isdelete=1")
    Integer selectcount();

    @Select("SELECT region  from prairie_caoyuan where  isdelete=1   GROUP BY  region;")
    List<Integer> selectcishu();

    @Select("SELECT count(region) as count from prairie_caoyuan   WHERE region=#{inte} and  isdelete=1")
    Integer selectc(Integer inte);

    @Select("SELECT     alertId    from prairie_caoyuan WHERE region=#{inte} and isdelete=1 GROUP BY alertId")
    List<Integer> cityandspecies(Integer inte);


  // 查询每一个预警发生的次数
    @Select("SELECT    count(speciesId)   from prairie_caoyuan WHERE region=#{inte} AND speciesId=#{cc} and isdelete=1")
    Integer selectyujing(@Param("inte") Integer inte, @Param("cc") Integer cc);


}
